package com.charlotte.gupao.study.producer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

/**
 * @author junjie.ding
 * @date 2020/11/4 17:01
 * @description TODO
 */
@Component
public class SimpleProducer {

    @Autowired
    private KafkaTemplate<String,Object> kafkaTemplate;

    public String send(String msg){
        kafkaTemplate.send("springboot-topic", msg);
        return "ok";
    }
}
